package com.zbcz.crm

import android.app.Application
import com.scwang.smart.refresh.footer.ClassicsFooter
import com.scwang.smart.refresh.header.ClassicsHeader
import com.scwang.smart.refresh.layout.SmartRefreshLayout


class CrmApplication : Application() {

    companion object {
        lateinit var mApplication: Application
        const val TAG = "CrmApplication"
    }


    override fun onCreate() {
        super.onCreate()
        mApplication = this
//        AutoSizeConfig.getInstance()
//            .setDesignWidthInDp(375)
//            .setDesignHeightInDp(812)
//        AutoSizeConfig.getInstance().isBaseOnWidth = true
        initRefresh()
    }

    private fun initRefresh() {
        // 设置全局的Header构建器
        SmartRefreshLayout.setDefaultRefreshHeaderCreator { context, _ ->
            ClassicsHeader(context).apply {
                setAccentColorId(R.color.blue_text_color) // 设置颜色
            }
        }

        // 设置全局的Footer构建器
        SmartRefreshLayout.setDefaultRefreshFooterCreator { context, _ ->
            ClassicsFooter(context).apply {
                setAccentColorId(R.color.blue_text_color) // 设置颜色
            }
        }
    }
}